/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tools;

import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Random;

public class RandomMatrixGenerator {

    private static final int N = 512;
    private static final int MAX_VALUE = 1024;

    private static void generateMatrix(String name, int size) throws IOException {
        Random random = new Random(System.currentTimeMillis());
        PrintWriter out = new PrintWriter(new FileWriter(name));
        for (int i = 0; i < N * N; i++) {
            out.println(random.nextInt(MAX_VALUE));
        }
        out.close();
    }

    public static void main(String[] args) {
        try {
            for (int i = 0; i < 16; i++) {
                generateMatrix("matrix" + i, N);
            }
        } catch (IOException e) {
            System.out.println("Error creating file: " + e.getMessage());
        }
    }
}
